package com.levi.functionalinterface;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;

/**
 * @author shentong
 * @date 2022/1/10 10:22 PM
 * @description  获取数据，并且有返回值
 */
public class MySupplierDemo {
    public static void get(Supplier<Integer> supplier){
        System.out.println(supplier.get());
    }

    public static void main(String[] args) {
        int[] intArr={6,9,2,0,4,99,1};
        get(()->{
            int min = intArr[0];
            for (int i : intArr) {
                if (i<min){
                    min = i;
                }
            }
            return min;
        });
    }
}
